import { defineStore } from 'pinia';

interface IUserState {
    id: number,
    name: string
}

export const userStore = defineStore({
    id: 'app-user',
    state: (): IUserState => ({
        id: 0,
        name: ''
    }),
    getters: {
        getId(): number {
            return this.id
        },
        getName(): string {
            return this.name
        }
    },
    actions: {
        updateId(id: number) {
            this.id = id
        },
        updateName(name: string) {
            this.name = name
        }
    }
})
